﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Web;

namespace Hbrs.Soa.Restclient.Prototype
{
    [ServiceContract]
    public interface ICollectionService<TItem> where TItem : Book
    {
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "")]
        void AddItemInXml(TItem initialValue);
        
        [WebInvoke(Method = "DELETE", UriTemplate = "{id}")]
        [OperationContract]
        void DeleteItem(string id);
        
        [WebGet(UriTemplate = "{id}")]
        [OperationContract]
        TItem GetItemInXml(string id);
        
        [WebGet(UriTemplate = "")]
        [OperationContract]
        List<TItem> GetItemsInXml();
        
        [WebInvoke(Method = "PUT", UriTemplate = "{id}")]
        [OperationContract]
        TItem UpdateItemInXml(string id, TItem newValue);
    }
}
